//
// Created by QU on 2023/12/16.
//

// 启用boost时间便捷类型
#define BOOST_DATE_TIME_OPTIONAL_GREGORAIN_TYPES

// 启用更高的时间精确度
#define BOOST_DATE_POSIX_TIME_STD_CONFIG

#include <iostream>

#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/local_time/local_time.hpp>
#include <boost/swap.hpp>


using std::cout;
using std::cin;
using std::endl;

using namespace boost::posix_time;
using namespace boost::gregorian;
using namespace boost::local_time;

int main(int argc, const char* argv[]){
    date d(2023,12,16);
    auto * dateFacet = new date_facet("%Y 年, %m 月, %d日");

    cout.imbue(boost_swap_impl::locale(cout.getloc(), dateFacet));
    // 我的IDE提示我使用boost_swap_impl::, std:: 也有这个函数.

    cout << ptime(d, hours(21) + minutes(50) + millisec(100) + microsec(200) ) << endl;
    // 2023-Dec-16 21:50:00.100200
}
